<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客详情</title>
    <link rel="stylesheet" href="./Css/common.css">
    <link rel="stylesheet" href="./Css/blog_detail.css">
    <!-- 引入 editor.md 的依赖 -->
    <link rel="stylesheet" href="editor.md/css/editormd.min.css" />
    <script src="js/jquery.min.js"></script>
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>

</head>
<body>
    <div class="nav">
        <img src="./image/西南石油大学.jpeg" alt="">
        <span>我的博客系统</span>
        <span class="spacer"></span>
        <a th:if="${showDeleteBtn}" th:href="${'blogDelete?blogId='+blog.blogId}">删除</a>
        <a href="blog_list.html">主页</a>
        <a href="blog_edit.html">写博客</a>
        <a href="logout">注销</a>
    </div>
    <div class="container">
        <div class="left">
            <div class="card">
                <img src="./image/图片2.jpeg" alt="">
                <h3 th:text="${user.username}"></h3>
                <a href="https://gitee.com/wen-junhao000">github地址</a>
                <div class="couter">
                    <span>文章</span>
                    <span>分类</span>
                </div>
                <div class="couter">
                    <span>1</span>
                    <span>2</span>
                </div>
            </div>
        </div>
        <div class="right">
            <div class="blog-content">
                <h3 th:text="${blog.title}"></h3>
                <div class="date" th:text="${blog.postTime}"></div>
                <div id="content" th:text="${blog.content}" style="background-color: transparent;"></div>
            </div>
        </div>
    </div>
    <script>
        function renderMD(){
            let contentDiv=document.querySelector('#content');
            let markdown=contentDiv.innerHTML;
            contentDiv.innerHTML='';
            editormd.markdownToHTML('content',{markdown:markdown});
        }
        renderMD();
    </script>
</body>
</html>